﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


using SiteParser.Core;
using System.Xml.Linq;
using SiteParser.Core.ParserEntities;
using System.Xml;
using System.IO;
using System.Text.RegularExpressions;
using SiteParser.Console.SitesConfig.SaksSite.Entities;
using System.Xml.Serialization;
using SiteParser.Console.SitesConfig.SaksSite.DataEntities;
using SiteParser.Core.Logging;
using SiteParser.Console.SitesConfig.TutByConfig.Entities;
using CSCEPlugin.CSCEEntities;
namespace SiteParser.Console
{
	public class ItemsClass
	{
		public List<string> Items { get; set; }
	}

	public class MyClass
	{
		public string Name { get; set; }
	}


	class Program
	{
		static void Main(string[] args) {

			/*XPathExpressionParser xPathParser = new XPathExpressionParser();
			xPathParser.Parse(@"\node1[@attr1 = val1]\node2\node3[@attr3 = val3]\@attr4");*/

			CommentCollection rentEntities = new CommentCollection();
			ConfigParserBuilder parserBuilder = new ConfigParserBuilder();

			ParserEntity parser = parserBuilder.BuildParser();

			ParsingContext context = new ParsingContext() {
				InnerEntity = rentEntities,
				InnerHtml = string.Empty
			};

			if (parser != null) {
				parser.Parse(context);
			}

			/*RentEntities rentEntities = new RentEntities();

			SaksSiteEntity myClass = new SaksSiteEntity();

			ConfigParserBuilder builder = new ConfigParserBuilder();
			var parser = builder.BuildParser();

			var context = new ParsingContext()
			{
				InnerEntity = myClass,
				InnerHtml = string.Empty
			};

			parser.Parse(context);*/

			/*ConfigParserBuilder builder = new ConfigParserBuilder();
			var parser = builder.BuildParser();

			SaksSiteEntity myClass = new SaksSiteEntity();

			var context = new ParsingContext() {
				InnerEntity = myClass,
				InnerHtml = string.Empty
			};*/

			/*parser.Parse(context);

			XmlSerializer xmlSerializer = new XmlSerializer(typeof(SaksSiteEntity));
			using (StreamWriter sWriter = new StreamWriter("ParsedSite.xml")) {
				xmlSerializer.Serialize(sWriter, myClass);
			}
			*/

			/*XmlSerializer xmlSerializer = new XmlSerializer(typeof(SaksSiteEntity));
			using (FileStream fStream = new FileStream("ParsedSite.xml", FileMode.Open)) {
				SaksSiteEntity saksSite = (SaksSiteEntity)xmlSerializer.Deserialize(fStream);

				MySqlDataImporter dbImporter = new MySqlDataImporter();
				dbImporter.ImportDataToDB(saksSite, "Server=localhost;Port=3306;Database=magento_db_1;Uid=root;Pwd=523092;allow zero datetime=yes");
			}*/

			System.Console.WriteLine("Finished");
			System.Console.Read();
		}
	}
}
